<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>DSpace Documentation : Installation</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            DSpace Documentation : Installation
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Mar 11, 2011 by <font color="#0050B2">stuartlewis</font>.
				    </div>

				    <h1><a name="Installation-DSpaceSystemDocumentation%3AInstallation"></a>DSpace System Documentation: Installation</h1>

<style type='text/css'>/*<![CDATA[*/
div.rbtoc1299806510998 {margin-left: 0px;padding: 0px;}
div.rbtoc1299806510998 ul {list-style: none;margin-left: 0px;}
div.rbtoc1299806510998 li {margin-left: 0px;padding-left: 0px;}

/*]]>*/</style><div class='rbtoc1299806510998'>
<ul>
    <li><span class='TOCOutline'>1</span> <a href='#Installation-FortheImpatient'>For the Impatient</a></li>
    <li><span class='TOCOutline'>2</span> <a href='#Installation-PrerequisiteSoftware'>Prerequisite Software</a></li>
<ul>
    <li><span class='TOCOutline'>2.1</span> <a href='#Installation-UNIXlikeOSorMicrosoftWindows'>UNIX-like OS or Microsoft Windows</a></li>
    <li><span class='TOCOutline'>2.2</span> <a href='#Installation-OracleJavaJDK6orlater%28standardSDKisfine%2Cyoudon%27tneedJ2EE%29'>Oracle Java JDK 6 or later (standard SDK is fine, you don't need J2EE)</a></li>
    <li><span class='TOCOutline'>2.3</span> <a href='#Installation-ApacheMaven2.2.x%28Javabuildtool%29'>Apache Maven 2.2.x (Java build tool)</a></li>
<ul>
    <li><span class='TOCOutline'>2.3.1</span> <a href='#Installation-ConfiguringaProxy'>Configuring a Proxy</a></li>
</ul>
    <li><span class='TOCOutline'>2.4</span> <a href='#Installation-ApacheAnt1.7orlater%28Javabuildtool%29'>Apache Ant 1.7 or later (Java build tool)</a></li>
    <li><span class='TOCOutline'>2.5</span> <a href='#Installation-RelationalDatabase%3A%28PostgreSQLorOracle%29.'>Relational Database: (PostgreSQL or Oracle).</a></li>
    <li><span class='TOCOutline'>2.6</span> <a href='#Installation-ServletEngine%3A%28ApacheTomcat5.5or6%2CJetty%2CCauchoResinorequivalent%29.'>Servlet Engine: (Apache Tomcat 5.5 or 6, Jetty, Caucho Resin or equivalent).</a></li>
    <li><span class='TOCOutline'>2.7</span> <a href='#Installation-Perl%28onlyrequiredfor%5Cdspace%5C%2Fbin%2Fdspaceinfo.pl%29'>Perl (only required for [dspace]/bin/dspace-info.pl)</a></li>
</ul>
    <li><span class='TOCOutline'>3</span> <a href='#Installation-InstallationInstructions'>Installation Instructions</a></li>
<ul>
    <li><span class='TOCOutline'>3.1</span> <a href='#Installation-OverviewofInstallOptions'>Overview of Install Options</a></li>
    <li><span class='TOCOutline'>3.2</span> <a href='#Installation-OverviewofDSpaceDirectories'>Overview of DSpace Directories</a></li>
    <li><span class='TOCOutline'>3.3</span> <a href='#Installation-Installation'>Installation</a></li>
</ul>
    <li><span class='TOCOutline'>4</span> <a href='#Installation-AdvancedInstallation'>Advanced Installation</a></li>
<ul>
    <li><span class='TOCOutline'>4.1</span> <a href='#Installation-%27cron%27Jobs'>'cron' Jobs</a></li>
    <li><span class='TOCOutline'>4.2</span> <a href='#Installation-MultilingualInstallation'>Multilingual Installation</a></li>
    <li><span class='TOCOutline'>4.3</span> <a href='#Installation-DSpaceoverHTTPS'>DSpace over HTTPS</a></li>
<ul>
    <li><span class='TOCOutline'>4.3.1</span> <a href='#Installation-ToenabletheHTTPSsupportinTomcat5.0%3A'>To enable the HTTPS support in Tomcat 5.0:</a></li>
    <li><span class='TOCOutline'>4.3.2</span> <a href='#Installation-TouseSSLonApacheHTTPDwithmodjk%3A'>To use SSL on Apache HTTPD with mod_jk:</a></li>
</ul>
    <li><span class='TOCOutline'>4.4</span> <a href='#Installation-TheHandleServer'>The Handle Server</a></li>
<ul>
    <li><span class='TOCOutline'>4.4.1</span> <a href='#Installation-UpdatingExistingHandlePrefixes'>Updating Existing Handle Prefixes</a></li>
</ul>
    <li><span class='TOCOutline'>4.5</span> <a href='#Installation-GoogleandHTMLsitemaps'>Google and HTML sitemaps</a></li>
    <li><span class='TOCOutline'>4.6</span> <a href='#Installation-DSpaceStatistics'>DSpace Statistics</a></li>
</ul>
    <li><span class='TOCOutline'>5</span> <a href='#Installation-WindowsInstallation'>Windows Installation</a></li>
<ul>
    <li><span class='TOCOutline'>5.1</span> <a href='#Installation-PrerequisiteSoftware'>Pre-requisite Software</a></li>
    <li><span class='TOCOutline'>5.2</span> <a href='#Installation-InstallationSteps'>Installation Steps</a></li>
</ul>
    <li><span class='TOCOutline'>6</span> <a href='#Installation-CheckingYourInstallation'>Checking Your Installation</a></li>
    <li><span class='TOCOutline'>7</span> <a href='#Installation-KnownBugs'>Known Bugs</a></li>
    <li><span class='TOCOutline'>8</span> <a href='#Installation-CommonProblems'>Common Problems</a></li>
</ul></div>

<h2><a name="Installation-FortheImpatient"></a>For the Impatient</h2>

<p>Since some users might want to get their test version up and running as fast as possible, offered below is an <em>unsupported</em> outline of getting DSpace to run quickly in a Unix-based environment.</p>

<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Only experienced unix admins should even attempt the following without going to the detailed <a href="#Installation-InstallationInstructions">Installation Instructions</a></td></tr></table></div>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">useradd -m dspace
gunzip -c dspace-1.x-src-release.tar.gz | tar -xf -
createuser -U postgres -d -A -P dspace
createdb -U dspace -E UNICODE dspace
cd [dspace-source]/dspace/config
vi dspace.cfg
mkdir [dspace]
chown dspace [dspace]
su - dspace
cd [dspace-source]/dspace
mvn <span class="code-keyword">package</span>
cd [dspace-source]/dspace/target/dspace-&lt;version&gt;-build.dir
ant fresh_install
cp -r [dspace]/webapps/* [tomcat]/webapps
/etc/init.d/tomcat start
[dspace]/bin/dspace create-administrator</pre>
</div></div>

<h2><a name="Installation-PrerequisiteSoftware"></a>Prerequisite Software</h2>

<p>The list below describes the third-party components and tools you'll need to run a DSpace server. These are just guidelines. Since DSpace is built on open source, standards-based tools, there are numerous other possibilities and setups.</p>

<p>Also, please note that the configuration and installation guidelines relating to a particular tool below are here for convenience. You should refer to the documentation for each individual component for complete and up-to-date details. Many of the tools are updated on a frequent basis, and the guidelines below may become out of date.</p>

<h3><a name="Installation-UNIXlikeOSorMicrosoftWindows"></a>UNIX-like OS or Microsoft Windows</h3>

<ul>
	<li>UNIX-like OS (Linux, HP/UX, Mac OSX, etc.) : Many distributions of Linux/Unix come with some of the dependencies below pre-installed or easily installed via updates, you should consult your particular distributions documentation or local system administrators to determine what is already available.</li>
	<li>Microsoft Windows: After verifying all prerequisites below, see the <a href="#Installation-WindowsInstallation">Windows Installation</a> section for Windows tailored instructions</li>
</ul>


<h3><a name="Installation-OracleJavaJDK6orlater%28standardSDKisfine%2Cyoudon%27tneedJ2EE%29"></a>Oracle Java JDK 6 or later (standard SDK is fine, you don't need J2EE)</h3>

<p>DSpace now requires <b>Oracle</b> Java 6 or greater because of usage of new language capabilities introduced in 5 and 6 that make coding easier and cleaner.</p>

<p>Java can be downloaded from the following location: <a href="http://java.sun.com/javase/downloads/index.jsp">http://java.sun.com/javase/downloads/index.jsp</a></p>


<p>Only Oracle's Java has been tested with each release and is known to work correctly. Other flavors of Java may pose problems.</p>

<h3><a name="Installation-ApacheMaven2.2.x%28Javabuildtool%29"></a>Apache Maven 2.2.x (Java build tool)</h3>

<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Known issue with Maven 2.0.x and Maven 3.x and DSpace 1.7.0</b><br />DSpace 1.7.0 does not build properly when using Maven 2.0.x or Maven 3.x.  This is a known issue. <b>The quick fix is to use Maven 2.2.x.</b> More information on this issue can be found in the following JIRA issue: <a href="https://jira.duraspace.org/browse/DS-788">DS-788</a>.</td></tr></table></div>

<p>Maven is necessary in the first stage of the build process to assemble the installation package for your DSpace instance. It gives you the flexibility to customize DSpace using the existing Maven projects found in the <em>[dspace-source]/dspace/modules</em> directory or by adding in your own Maven project to build the installation package for DSpace, and apply any custom interface "overlay" changes.</p>

<p>Maven can be downloaded from the following location: <a href="http://maven.apache.org/download.html">http://maven.apache.org/download.html</a></p>


<h4><a name="Installation-ConfiguringaProxy"></a>Configuring a Proxy</h4>

<p>You can configure a proxy to use for some or all of your HTTP requests in Maven 2.0. The username and password are only required if your proxy requires basic authentication (note that later releases may support storing your passwords in a secured keystore‚ in the mean time, please ensure your <em>settings.xml</em> file (usually <em>${user.home}/.m2/settings.xml</em>) is secured with permissions appropriate for your operating system).</p>

<p>Example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;settings&gt;
  .
  .
  &lt;proxies&gt;
   &lt;proxy&gt;
      &lt;active&gt;<span class="code-keyword">true</span>&lt;/active&gt;
      &lt;protocol&gt;http&lt;/protocol&gt;
      &lt;host&gt;proxy.somewhere.com&lt;/host&gt;
      &lt;port&gt;8080&lt;/port&gt;
      &lt;username&gt;proxyuser&lt;/username&gt;
      &lt;password&gt;somepassword&lt;/password&gt;
      &lt;nonProxyHosts&gt;www.google.com|*.somewhere.com&lt;/nonProxyHosts&gt;
    &lt;/proxy&gt;
  &lt;/proxies&gt;
  .
  .
&lt;/settings&gt; </pre>
</div></div>


<h3><a name="Installation-ApacheAnt1.7orlater%28Javabuildtool%29"></a>Apache Ant 1.7 or later (Java build tool)</h3>

<p>Apache Ant is still required for the second stage of the build process. It is used once the installation package has been constructed in <em>[dspace-source]/dspace/target/dspace-&lt;version&gt;-build.dir</em> and still uses some of the familiar ant build targets found in the 1.4.x build process.</p>

<p>Ant can be downloaded from the following location: <a href="http://ant.apache.org/" title="http://ant.apache.org">http://ant.apache.org</a></p>



<h3><a name="Installation-RelationalDatabase%3A%28PostgreSQLorOracle%29."></a>Relational Database: (PostgreSQL or Oracle).</h3>

<ul>
	<li><b>PostgreSQL 8.2 to 8.4</b> PostgreSQL can be downloaded from the following location: <a href="http://www.postgresql.org/" title="http://www.postgresql.org/">http://www.postgresql.org/ </a>. It is highly recommended that you try to work with Postgres 8.4 or greater, however, 8.2 or greater should still work. Unicode (specifically UTF-8) support must be enabled. This is enabled by default in 8.0+.  Once installed, you need to enable TCP/IP connections (DSpace uses JDBC).  In <em>postgresql.conf</em>: uncomment the line starting: <em>listen_addresses = 'localhost'</em>. Then tighten up security a bit by editing <em>pg_hba.conf</em> and adding this line: <em>host dspace dspace 127.0.0.1 255.255.255.255 md5</em>.  Then restart PostgreSQL.</li>
	<li><b>Oracle 10g or greater</b> Details on acquiring Oracle can be downloaded from the following location: <a href="http://www.oracle.com/database/" title="http://www.oracle.com/database/">http://www.oracle.com/database/</a>. You will need to create a database for DSpace. Make sure that the character set is one of the Unicode character sets. DSpace uses UTF-8 natively, and it is suggested that the Oracle database use the same character set. You will also need to create a user account for DSpace (e.g. <em>dspace</em>) and ensure that it has permissions to add and remove tables in the database. Refer to the Quick Installation for more details.
	<ul>
		<li><b>NOTE:</b> DSpace uses sequences to generate unique object IDs &#8212; beware Oracle sequences, which are said to lose their values when doing a database export/import, say restoring from a backup. Be sure to run the script <em>etc/update-sequences.sql</em>.</li>
		<li>For people interested in switching from Postgres to Oracle, I know of no tools that would do this automatically. You will need to recreate the community, collection, and eperson structure in the Oracle system, and then use the item export and import tools to move your content over.</li>
	</ul>
	</li>
</ul>


<h3><a name="Installation-ServletEngine%3A%28ApacheTomcat5.5or6%2CJetty%2CCauchoResinorequivalent%29."></a>Servlet Engine: (Apache Tomcat 5.5 or 6, Jetty, Caucho Resin or equivalent).</h3>

<ul>
	<li><b>Apache Tomcat 5.5 or later.</b> Tomcat can be downloaded from the following location: <a href="http://tomcat.apache.org/whichversion.html" title="http://tomcat.apache.org">http://tomcat.apache.org</a>.
	<ul>
		<li>Note that DSpace will need to run as the same user as Tomcat, so you might want to install and run Tomcat as a user called '<em>dspace</em>'. Set the environment variable <em>TOMCAT_USER</em> appropriately.</li>
		<li>You need to ensure that Tomcat has a) enough memory to run DSpace and b) uses UTF-8 as its default file encoding for international character support. So ensure in your startup scripts (etc) that the following environment variable is set: <em>JAVA_OPTS="-Xmx512M &#45;Xms64M &#45;Dfile.encoding=UTF-8"</em></li>
		<li><b>Modifications in</b> <b><em>[tomcat]/conf/server.xml</em></b>:  You also need to alter Tomcat's default configuration to support searching and browsing of multi-byte UTF-8 correctly. You need to add a configuration option to the <em>&lt;Connector&gt;</em> element in <em>[tomcat]/config/server.xml</em>: <em>URIEncoding="UTF-8"</em> e.g. if you're using the default Tomcat config, it should read:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --&gt;
&lt;Connector port=<span class="code-quote">"8080"</span>
              maxThreads=<span class="code-quote">"150"</span>
              minSpareThreads=<span class="code-quote">"25"</span>
	      maxSpareThreads=<span class="code-quote">"75"</span>
              enableLookups=<span class="code-quote">"<span class="code-keyword">false</span>"</span>
              redirectPort=<span class="code-quote">"8443"</span>
	      acceptCount=<span class="code-quote">"100"</span>
              connectionTimeout=<span class="code-quote">"20000"</span>
	      disableUploadTimeout=<span class="code-quote">"<span class="code-keyword">true</span>"</span>
              URIEncoding=<span class="code-quote">"UTF-8"</span>/&gt;
</pre>
</div></div>
<p>You may change the port from 8080 by editing it in the file above, and by setting the variable <em>CONNECTOR_PORT</em> in <em>server.xml</em>.
<br class="atl-forced-newline" /></p></li>
	</ul>
	</li>
	<li><b>Jetty or Caucho Resin</b> DSpace will also run on an equivalent servlet Engine, such as Jetty (<a href="http://www.mortbay.org/jetty/index.html" title="http://www.mortbay.org/jetty/index.html">http://www.mortbay.org/jetty/index.html</a>) or Caucho Resin (<a href="http://www.caucho.com/" title="http://www.caucho.com/)">http://www.caucho.com/)</a>.  Jetty and Resin are configured for correct handling of UTF-8 by default.</li>
</ul>


<h3><a name="Installation-Perl%28onlyrequiredfor%5Cdspace%5C%2Fbin%2Fdspaceinfo.pl%29"></a>Perl (only required for [dspace]/bin/dspace-info.pl)</h3>


<h2><a name="Installation-InstallationInstructions"></a>Installation Instructions</h2>

<h3><a name="Installation-OverviewofInstallOptions"></a>Overview of Install Options</h3>

<p>With the advent of a new Apache <a href="http://maven.apache.org/" title="Maven 2">Maven 2</a> based build architecture (first introduced inDSpace 1.5.x), you now have two options in how you may wish to install and manage your local installation of DSpace. If you've used DSpace 1.4.x, please recognize that the initial build procedure has changed to allow for more customization. You will find the later 'Ant based' stages of the installation procedure familiar. Maven is used to resolve the dependencies of DSpace online from the 'Maven Central Repository' server.</p>

<p>It is important to note that the strategies are identical in terms of the list of procedures required to complete the build process, the only difference being that the Source Release includes "more modules" that will be built given their presence in the distribution package.</p>

<ul>
	<li>Default Release (dspace-&lt;version&gt;-release.zip)
	<ul>
		<li>This distribution will be adequate for most cases of running a DSpace instance. It is intended to be the quickest way to get DSpace installed and running while still allowing for customization of the themes and branding of your DSpace instance.</li>
		<li>This method allows you to customize DSpace configurations (in dspace.cfg) or user interfaces, using basic pre-built interface "overlays".</li>
		<li>It downloads "precompiled" libraries for the core dspace-api, supporting servlets, taglibraries, aspects and themes for the dspace-xmlui, dspace-xmlui and other webservice/applications.</li>
		<li>This approach exposes the parts of the application that the DSpace committers would prefer to see customized. All other modules are downloaded from the 'Maven Central Repository' The directory structure for this release is the following:
		<ul>
			<li><em>[dspace-source]</em>
			<ul>
				<li><em>dspace/</em> &#45; DSpace 'build' and configuration module</li>
				<li><em>pom.xml</em> &#45; DSpace Parent Project definition</li>
			</ul>
			</li>
		</ul>
		</li>
	</ul>
	</li>
	<li>Source Release (dspace-&lt;version&gt;-src-release.zip)
	<ul>
		<li>This method is recommended for those who wish to develop DSpace further or alter its underlying capabilities to a greater degree.</li>
		<li>It contains <b>all</b> dspace code for the core dspace-api, supporting servlets, taglibraries, aspects and themes for Manakin (dspace-xmlui), and other webservice/applications.</li>
		<li>Provides all the same capabilities as the normal release. The directory structure for this release is more detailed:
		<ul>
			<li><em>[dspace-source]</em>
			<ul>
				<li><em>dspace/</em> &#45; DSpace 'build' and configuration module</li>
				<li><em>dspace-api/</em> &#45; Java API source module</li>
				<li><em>dspace-jspui/</em> &#45; JSP-UI source module</li>
				<li><em>dspace-oai</em> &#45; OAI-PMH source module</li>
				<li><em>dspace-xmlui</em> &#45; XML-UI (Manakin) source module</li>
				<li><em>dspace-lni</em> &#45; Lightweight Network Interface source module</li>
				<li><em>dspace-sword</em> &#8211; SWORD (Simple Web-serve Offering Repository Deposit) deposit service source module</li>
				<li><em>dspace-test</em> &#8211; DSpace Tests (Unit and Integration Tests)</li>
				<li><em>pom.xml</em> &#45; DSpace Parent Project definition</li>
			</ul>
			</li>
		</ul>
		</li>
	</ul>
	</li>
</ul>


<h3><a name="Installation-OverviewofDSpaceDirectories"></a>Overview of DSpace Directories</h3>

<p>Before beginning an installation, it is important to get a general understanding of the DSpace directories and the names by which they are generally referred. (Please attempt to use these below directory names when asking for help on the DSpace Mailing Lists, as it will help everyone better understand what directory you may be referring to.)</p>

<p>DSpace uses three separate directory trees. Although you don't need to know all the details of them in order to install DSpace, you do need to know they exist and also know how they're referred to in this document:</p>

<ol>
	<li><b>The installation directory</b>, referred to as <tt>[dspace]</tt>. This is the location where DSpace is installed and running off of it is the location that gets defined in the <tt>dspace.cfg</tt> as "dspace.dir". It is where all the DSpace configuration files, command line scripts, documentation and webapps will be installed to.</li>
	<li><b>The source directory</b>, referred to as <tt>[dspace-source]</tt> . This is the location where the DSpace release distribution has been unzipped into. It usually has the name of the archive that you expanded such as <tt>dspace</tt>&#45;<tt>&lt;version&gt;</tt>&#45;<tt>release</tt> or <tt>dspace</tt>&#45;<tt>&lt;version&gt;</tt>&#45;<tt>src</tt>&#45;<tt>release</tt>. It is the directory where all of your "build" commands will be run.</li>
	<li><b>The web deployment directory</b>. This is the directory that contains your DSpace web application(s). In DSpace 1.5.x and above, this corresponds to <tt>[dspace]/webapps</tt> by default. However, if you are using Tomcat, you may decide to copy your DSpace web applications from <tt>[dspace]/webapps/</tt> to <tt>[tomcat]/webapps/</tt> (with <tt>[tomcat]</tt> being wherever you installed Tomcat‚ also known as <tt>$CATALINA_HOME</tt>).<br/>
For details on the contents of these separate directory trees, refer to directories.html. <em>Note that the</em> <tt>[dspace-source]</tt> <em>and</em> <tt>[dspace]</tt> <em>directories are always separate&#33;</em></li>
</ol>



<h3><a name="Installation-Installation"></a>Installation</h3>

<p>This method gets you up and running with DSpace quickly and easily. It is identical in both the Default Release and Source Release distributions.</p>

<ol>
	<li><b>Create the DSpace user</b>. This needs to be the same user that Tomcat (or Jetty etc.) will run as. e.g. as <b><em>root</em></b> run:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">useradd -m dspace</pre>
</div></div></li>
	<li><b>Download</b> the <a href="http://sourceforge.net/projects/dspace/" title="latest DSpace release">latest DSpace release</a> There are two version available with each release of DSpace: (<em>dspace-1.x-release.</em> and <em>dspace-1.x-src-release.xxx</em>); you only need to choose one. If you want a copy of all underlying Java source code, you should download the <em>dspace-1.x-src-release.xxx</em> Within each version, you have a choice of compressed file format. Choose the one that best fits your environment.</li>
	<li><b>Unpack the DSpace software</b>. After downloading the software, based on the compression file format, choose one of the following methods to unpack your software:
	<ol>
		<li><b>Zip file</b>. If you downloaded <em>dspace-1.6-release.zip</em> do the following:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">unzip dspace-1.7-release.zip</pre>
</div></div></li>
		<li><b>.gz file</b>. If you downloaded <em>dspace-1.6-release.tar.gz</em> do the following:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">gunzip -c dspace-1.7-release.tar.gz | tar -xf -</pre>
</div></div></li>
		<li><b>.bz2 file</b>. If you downloaded &#95;dspace-1.6-release.tar.bz2_do the following:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">bunzip2 dspace-1.7-release.tar.bz | tar -xf -</pre>
</div></div>
<p>For ease of reference, we will refer to the location of this unzipped version of the DSpace release as <em>[dspace-source]</em> in the remainder of these instructions. After unpacking the file, the user may which to change the ownership of the <em>dspace-1.6-release</em> to the 'dspace' user. (And you may need to change the group).</p></li>
	</ol>
	</li>
	<li><b>Database Setup</b>
	<ul>
		<li><em>PostgreSQL:</em>
		<ul>
			<li>A PostgreSQL JDBC driver is configured as part of the default DSpace build. You no longer need to copy any PostgreSQL jars to get PostgreSQL installed.</li>
			<li>Create a <tt>dspace}}database, owned by the {{dspace</tt> PostgreSQL user <em>(you are still logged in at 'root')</em>:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">createuser -U postgres -d -A -P dspace 
createdb -U dspace -E UNICODE dspace</pre>
</div></div>
<p>You will be prompted for a password for the DSpace database. (This isn't the same as the <em>dspace</em> user's UNIX password.)</p></li>
		</ul>
		</li>
		<li><em>Oracle:</em>
		<ul>
			<li>Setting up oracle is a bit different now. You will need still need to get a Copy of the oracle JDBC driver, but instead of copying it into a lib directory you will need to install it into your local Maven repository. (You'll need to download it first from this location: <a href="http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html">http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html</a>)  Run the following command (all on one line)
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">mvn install:install-file -Dfile=ojdbc6.jar -DgroupId=com.oracle
    -DartifactId=ojdbc6 -Dversion=11.2.0.2.0 -Dpackaging=jar -DgeneratePom=<span class="code-keyword">true</span></pre>
</div></div></li>
			<li>Create a database for DSpace. Make sure that the character set is one of the Unicode character sets. DSpace uses UTF-8 natively, and it is required that the Oracle database use the same character set. Create a user account for DSpace (e.g. <em>dspace</em>,) and ensure that it has permissions to add and remove tables in the database.</li>
			<li>Edit the <em>[dspace-source]/dspace/config/dspace.cfg</em> database settings:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">db.name   = oracle
db.url    = jdbc:oracle:thin:@<span class="code-comment">//host:port/dspace
</span>db.driver = oracle.jdbc.OracleDriver
</pre>
</div></div></li>
		</ul>
		</li>
	</ul>
	</li>
	<li><b>Initial Configuration:</b> Edit <tt>[dspace-source]/dspace/config/dspace.cfg</tt>, in particular you'll need to set these properties:
	<ul>
		<li><tt>dspace.dir</tt> &#45;  must be set to the <em>[dspace]</em> (installation) directory.</li>
		<li><tt>dspace.url</tt> &#45; complete URL of this server's DSpace home page.</li>
		<li><tt>dspace.hostname</tt> &#45; fully-qualified domain name of web server.</li>
		<li><tt>dspace.name</tt> &#45; "Proper" name of your server, e.g. "My Digital Library".</li>
		<li><tt>db.password</tt> &#45; the database password you entered in the previous step.</li>
		<li><tt>mail.server</tt> &#45; fully-qualified domain name of your outgoing mail server.</li>
		<li><tt>mail.from.address</tt> &#45; the "From:" address to put on email sent by DSpace.</li>
		<li><tt>feedback.recipient</tt> &#45; mailbox for feedback mail.</li>
		<li><tt>mail.admin</tt> &#45; mailbox for DSpace site administrator.</li>
		<li><tt>alert.recipient</tt> &#45; mailbox for server errors/alerts (not essential but very useful&#33;)</li>
		<li><tt>registration.notify</tt> &#45; mailbox for emails when new users register (optional)
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>You can interpolate the value of one configuration variable in the value of another one. For example, to set <em>feedback.recipient</em> to the same value as <em>mail.admin</em>, the line would look like:
<br class="atl-forced-newline" />  <tt>feedback.recipient = ${mail.admin</tt>}
<br class="atl-forced-newline" />
Refer to the <a href="Configuration.html#Configuration-GeneralConfiguration">General Configuration</a> section for details and examples of the above.</td></tr></table></div></li>
	</ul>
	</li>
	<li><b>DSpace Directory:</b> Create the directory for the DSpace installation (i.e. <tt>[dspace]</tt>). As <em>root</em> (or a user with appropriate permissions), run:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">mkdir [dspace]
chown dspace [dspace]</pre>
</div></div>
<p>(Assuming the <em>dspace</em> UNIX username.)</p></li>
	<li><b>Installation Package:</b> As the <em>dspace</em> UNIX user, generate the DSpace installation package in the <tt>[dspace-source]/dspace</tt> directory:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">cd [dspace-source]/dspace/
mvn <span class="code-keyword">package</span></pre>
</div></div>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Defaults to PostgreSQL settings</b><br />Without any extra arguments, the DSpace installation package is initialized for PostgreSQL. &#95;If you want to use Oracle instead, you should build the DSpace installation package as follows:
<br class="atl-forced-newline" />  <tt>mvn &#45;Ddb.name=oracle package</tt></td></tr></table></div></li>
	<li><b>Build DSpace and Initialize Database:</b> As the <em>dspace</em> UNIX user, initialize the DSpace database and install DSpace to <tt>[dspace]&#95;</tt>:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">cd [dspace-source]/dspace/target/dspace-[version]-build.dir
ant fresh_install</pre>
</div></div>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>To see a complete list of build targets, run: <tt>ant help</tt> <em>The most likely thing to go wrong here is the database connection. See the</em> <em><a href="#Installation-CommonProblems">Common Problems</a></em> <em>Section</em>.</td></tr></table></div></li>
	<li><b>Deploy Web Applications.</b> You have two choices or techniques for having Tomcat/Jetty/Resin serve up your web applications:
	<ul>
		<li><em>Technique A.</em> Simple and complete. You copy only (or all) of the DSpace Web application(s) you wish to use from the [dspace]/webapps directory to the appropriate directory in your Tomcat/Jetty/Resin installation. For example:
<br class="atl-forced-newline" />  <tt>cp &#45;R [dspace]/webapps/&#42; [tomcat]/webapps&#42;</tt> (This will copy all the web applications to Tomcat).
<br class="atl-forced-newline" />  <tt>cp &#45;R [dspace]/webapps/jspui [tomcat]/webapps&#42;</tt> (This will copy only the jspui web application to Tomcat.)</li>
		<li><em>Technique B.</em> Tell your Tomcat/Jetty/Resin installation where to find your DSpace web application(s). As an example, in the <tt>\&lt;Host</tt>&gt; section of your <tt>[tomcat]/conf/server.xml</tt> you could add lines similar to the following (but replace <tt>[dspace]</tt> with your installation location:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;!-- Define the <span class="code-keyword">default</span> virtual host
	Note:  XML Schema validation will not work with Xerces 2.2.
	--&gt;
	&lt;Host name=<span class="code-quote">"localhost"</span>  appBase=<span class="code-quote">"[dspace]/webapps"</span>
	....</pre>
</div></div></li>
	</ul>
	</li>
	<li><b>Administrator Account:</b> Create an initial administrator account:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace create-administrator</pre>
</div></div></li>
	<li><b>Initial Startup&#33;</b> Now the moment of truth&#33; Start up (or restart) Tomcat/Jetty/Resin. Visit the base URL(s) of your server, depending on which DSpace web applications you want to use. You should see the DSpace home page. Congratulations&#33; Base URLs of DSpace Web Applications:
	<ul>
		<li><em>JSP User Interface</em> &#45; (e.g.) <tt><a href="http://dspace.myu.edu:8080/jspui">http://dspace.myu.edu:8080/jspui</a></tt></li>
		<li><em>XML User Interface</em> (aka. Manakin) - (e.g.) <tt><a href="http://dspace.myu.edu:8080/xmlui">http://dspace.myu.edu:8080/xmlui</a></tt></li>
		<li><em>OAI-PMH Interface</em> &#45; (e.g.) <tt><a href="http://dspace.myu.edu:8080/oai/request?verb=Identify">http://dspace.myu.edu:8080/oai/request?verb=Identify</a></tt> (Should return an XML-based response)</li>
	</ul>
	</li>
</ol>


<p>In order to set up some communities and collections, you'll need to login as your DSpace Administrator (which you created with <tt>create-administrator</tt> above) and access the administration UI in either the JSP or XML user interface.</p>



<h2><a name="Installation-AdvancedInstallation"></a>Advanced Installation</h2>

<p>The above installation steps are sufficient to set up a test server to play around with, but there are a few other steps and options you should probably consider before deploying a DSpace production site.</p>

<h3><a name="Installation-%27cron%27Jobs"></a>'cron' Jobs</h3>

<p>A couple of DSpace features require that a script is run regularly &#8211; the e-mail subscription feature that alerts users of new items being deposited, and the new 'media filter' tool, that generates thumbnails of images and extracts the full-text of documents for indexing.</p>

<p>To set these up, you just need to run the following command as the <em>dspace</em> UNIX user:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">crontab -e</pre>
</div></div>
<p>Then add the following lines:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"># Send out subscription e-mails at 01:00 every day
0 1 * * *  [dspace]/bin/dspace sub-daily
# Run the media filter at 02:00 every day
0 2 * * *  [dspace]/bin/dspace filter-media
# Run the checksum checker at 03:00
0 3 * * *  [dspace]/bin/dspace checker -lp
# Mail the results to the sysadmin at 04:00
0 4 * * *  [dspace]/bin/dspace checker-emailer -c
</pre>
</div></div>
<p>Naturally you should change the frequencies to suit your environment.</p>

<p>PostgreSQL also benefits from regular 'vacuuming', which optimizes the indexes and clears out any deleted data. Become the <em>postgres</em> UNIX user, run <em>crontab &#45;e</em> and add (for example):</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"># Clean up the database nightly at 4.20am
20 4 * * * vacuumdb --analyze dspace &gt; /dev/<span class="code-keyword">null</span> 2&gt;&amp;1</pre>
</div></div>
<p>In order that statistical reports are generated regularly and thus kept up to date you should set up the following cron jobs:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"># Run stat analysis
0 1 * * * [dspace]/bin/dspace stat-general
0 1 * * * [dspace]/bin/dspace stat-monthly
0 2 * * * [dspace]/bin/dspace stat-report-general
0 2 * * * [dspace]/bin/dspace stat-report-monthly</pre>
</div></div>
<p>Obviously, you should choose execution times which are most useful to you, and you should ensure that the <em><del>report</del></em> scripts run a short while after the analysis scripts to give them time to complete (a run of around 8 months worth of logs can take around 25 seconds to complete); the resulting reports will let you know how long analysis took and you can adjust your cron times accordingly.</p>


<h3><a name="Installation-MultilingualInstallation"></a>Multilingual Installation</h3>

<p>In order to deploy a multilingual version of DSpace you have to configure two parameters in <em>[dspace-source]/config/dspace.cfg:</em></p>

<ul>
	<li><em>default.locale</em>, e.g. <tt>default.locale = en</tt></li>
	<li><em>webui.supported locales</em>, e.g. <tt>webui.supported.locales = en, de</tt></li>
</ul>


<p>The Locales might have the form country, country_language, country_language_variant.</p>

<p>According to the languages you wish to support, you have to make sure, that all the i18n related files are available see the Multilingual User Interface Configuring MultiLingual Support section for the JSPUI or the Multilingual Support for XMLUI in the configuration documentation.</p>


<h3><a name="Installation-DSpaceoverHTTPS"></a>DSpace over HTTPS</h3>

<p>If your DSpace is configured to have users login with a username and password (as opposed to, say, client Web certificates), then you should consider using HTTPS. Whenever a user logs in with the Web form (e.g. <em>dspace.myuni.edu/dspace/password-login</em>) their DSpace password is exposed in plain text on the network. This is a very serious security risk since network traffic monitoring is very common, especially at universities. If the risk seems minor, then consider that your DSpace administrators also login this way and they have ultimate control over the archive.</p>

<p>The solution is to use <em>HTTPS</em> (HTTP over SSL, i.e. Secure Socket Layer, an encrypted transport), which protects your passwords against being captured. You can configure DSpace to require SSL on all "authenticated" transactions so it only accepts passwords on SSL connections.</p>

<p>The following sections show how to set up the most commonly-used Java Servlet containers to support HTTP over SSL.</p>

<h4><a name="Installation-ToenabletheHTTPSsupportinTomcat5.0%3A"></a>To enable the HTTPS support in Tomcat 5.0:</h4>

<ol>
	<li><b>For Production use:</b> Follow this procedure to set up SSL on your server. Using a "real" server certificate ensures your users' browsers will accept it without complaints. In the examples below, <em>$CATALINA_BASE</em> is the directory under which your Tomcat is installed.
	<ol>
		<li>Create a Java keystore for your server with the password <em>changeit</em>, and install your server certificate under the alias <em>"tomcat"</em>. This assumes the certificate was put in the file <em>server.pem</em>:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">$JAVA_HOME/bin/keytool -<span class="code-keyword">import</span> -noprompt -v -storepass changeit
	-keystore $CATALINA_BASE/conf/keystore -alias tomcat -file
	myserver.pem</pre>
</div></div></li>
		<li>Install the CA (Certifying Authority) certificate for the CA that granted your server cert, if necessary. This assumes the server CA certificate is in <em>ca.pem</em>:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> $JAVA_HOME/bin/keytool -<span class="code-keyword">import</span> -noprompt -storepass changeit
	-trustcacerts -keystore $CATALINA_BASE/conf/keystore -alias ServerCA
	-file ca.pem
</pre>
</div></div></li>
		<li>Optional &#8211; ONLY if you need to accept client certificates for the X.509 certificate stackable authentication module See the configuration section for instructions on enabling the X.509 authentication method. Load the keystore with the CA (certifying authority) certificates for the authorities of any clients whose certificates you wish to accept. For example, assuming the client CA certificate is in <em>client1.pem</em>:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">$JAVA_HOME/bin/keytool -<span class="code-keyword">import</span> -noprompt -storepass changeit
	-trustcacerts -keystore $CATALINA_BASE/conf/keystore  -alias client1
	-file client1.pem
</pre>
</div></div></li>
		<li>Now add another Connector tag to your <em>server.xml</em> Tomcat configuration file, like the example below. The parts affecting or specific to SSL are shown in bold. (You may wish to change some details such as the port, pathnames, and keystore password)
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">     &lt;Connector port=<span class="code-quote">"8443"</span>
               maxThreads=<span class="code-quote">"150"</span> minSpareThreads=<span class="code-quote">"25"</span>
	           maxSpareThreads=<span class="code-quote">"75"</span>
               enableLookups=<span class="code-quote">"<span class="code-keyword">false</span>"</span>
	           disableUploadTimeout=<span class="code-quote">"<span class="code-keyword">true</span>"</span>
               acceptCount=<span class="code-quote">"100"</span> debug=<span class="code-quote">"0"</span>
              scheme=<span class="code-quote">"https"</span> secure=<span class="code-quote">"<span class="code-keyword">true</span>"</span> sslProtocol=<span class="code-quote">"TLS"</span>
	keystoreFile=<span class="code-quote">"conf/keystore"</span> keystorePass=<span class="code-quote">"changeit"</span> clientAuth=<span class="code-quote">"<span class="code-keyword">true</span>"</span> - ONLY <span class="code-keyword">if</span> using client X.509 certs <span class="code-keyword">for</span> authentication!
	truststoreFile=<span class="code-quote">"conf/keystore"</span> trustedstorePass=<span class="code-quote">"changeit"</span> /&gt;
</pre>
</div></div>
<p>Also, check that the default Connector is set up to redirect "secure" requests to the same port as your SSL connector, e.g.: </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;Connector port=<span class="code-quote">"8080"</span>
                 maxThreads=<span class="code-quote">"150"</span> minSpareThreads=<span class="code-quote">"25"</span>
	             maxSpareThreads=<span class="code-quote">"75"</span>
                 enableLookups=<span class="code-quote">"<span class="code-keyword">false</span>"</span>
	             redirectPort=<span class="code-quote">"8443"</span>
                 acceptCount=<span class="code-quote">"100"</span> debug=<span class="code-quote">"0"</span>  	/&gt;
</pre>
</div></div></li>
	</ol>
	</li>
	<li><b>Quick-and-dirty Procedure for Testing:</b> If you are just setting up a DSpace server for testing, or to experiment with HTTPS, then you don't need to get a real server certificate. You can create a "self-signed" certificate for testing; web browsers will issue warnings before accepting it but they will function exactly the same after that as with a "real" certificate.  In the examples below, <em>$CATALINA_BASE</em> is the directory under which your Tomcat is installed.
	<ol>
		<li>Optional &#8211; ONLY if you don't already have a server certificate. Follow this sub-procedure to request a new, signed server certificate from your Certifying Authority (CA):
		<ul>
			<li>Create a new key pair under the alias name <em>"tomcat"</em>. When generating your key, give the Distinguished Name fields the appropriate values for your server and institution. CN should be the fully-qualified domain name of your server host. Here is an example:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -keysize
	1024 \
  -keystore $CATALINA_BASE/conf/keystore -storepass changeit
	-validity 365 \
  -dname 'CN=dspace.myuni.edu, OU=MIT Libraries, O=Massachusetts
	Institute of Technology, L=Cambridge, S=MA, C=US'

</pre>
</div></div></li>
			<li>Then, create a <em>CSR</em> (Certificate Signing Request) and send it to your Certifying Authority. They will send you back a signed Server Certificate. This example command creates a CSR in the file <em>tomcat.csr</em>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> $JAVA_HOME/bin/keytool -keystore $CATALINA_BASE/conf/keystore
	-storepass changeit \
   -certreq -alias tomcat -v -file tomcat.csr
</pre>
</div></div></li>
			<li>Before importing the signed certificate, you must have the CA's certificate in your keystore as a <em>trusted certificate</em>. Get their certificate, and import it with a command like this (for the example <em>mitCA.pem</em>):
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> $JAVA_HOME/bin/keytool -keystore $CATALINA_BASE/conf/keystore
	-storepass changeit \
     -<span class="code-keyword">import</span> -alias mitCA -trustcacerts -file mitCA.pem
</pre>
</div></div></li>
			<li>Finally, when you get the signed certificate from your CA, import it into the keystore with a command like the following example: (cert is in the file <em>signed-cert.pem</em>)
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> $JAVA_HOME/bin/keytool -keystore $CATALINA_BASE/conf/keystore
	-storepass changeit \
     -<span class="code-keyword">import</span> -alias tomcat -trustcacerts -file signed-cert.pem
</pre>
</div></div>
<p> Since you now have a signed server certificate in your keystore, you can, obviously, skip the next steps of installing a signed server certificate and the server CA's certificate.</p></li>
		</ul>
		</li>
		<li>Create a Java keystore for your server with the password <em>changeit</em>, and install your server certificate under the alias <em>"tomcat"</em>. This assumes the certificate was put in the file <em>server.pem</em>:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore
	$CATALINA_BASE/conf/keystore -storepass changeit
</pre>
</div></div>
<p>When answering the questions to identify the certificate, be sure to respond to "First and last name" with the fully-qualified domain name of your server (e.g. <em>test-dspace.myuni.edu</em>). The other questions are not important.</p></li>
		<li>Optional &#8211; ONLY if you need to accept client certificates for the X.509 certificate stackable authentication module See the configuration section for instructions on enabling the X.509 authentication method. Load the keystore with the CA (certifying authority) certificates for the authorities of any clients whose certificates you wish to accept. For example, assuming the client CA certificate is in <em>client1.pem</em>:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> $JAVA_HOME/bin/keytool -<span class="code-keyword">import</span> -noprompt -storepass changeit
	-trustcacerts -keystore $CATALINA_BASE/conf/keystore  -alias client1
	-file client1.pem
</pre>
</div></div></li>
		<li>Follow the procedure in the section above to add another Connector tag, for the HTTPS port, to your <em>server.xml</em> file.</li>
	</ol>
	</li>
</ol>


<h4><a name="Installation-TouseSSLonApacheHTTPDwithmodjk%3A"></a>To use SSL on Apache HTTPD with mod_jk:</h4>

<p>If you choose <a href="http://httpd.apache.org/" title="Apache HTTPD">Apache HTTPD</a> as your primary HTTP server, you can have it forward requests to the <a href="http://tomcat.apache.org/" title="Tomcat servlet container">Tomcat servlet container</a> via <a href="http://tomcat.apache.org/connectors-doc/" title="Apache Jakarta Tomcat Connector">Apache Jakarta Tomcat Connector</a>. This can be configured to work over SSL as well. First, you must configure Apache for SSL; for Apache 2.0 see <a href="http://httpd.apache.org/docs/2.0/ssl/" title="Apache SSL/TLS Encryption">Apache SSL/TLS Encryption</a> for information about using <a href="http://httpd.apache.org/docs/2.0/mod/mod_ssl.html" title="mod_ssl">mod_ssl</a>.</p>

<p><b><em>If you are using X.509 Client Certificates for authentication:</em></b> add these configuration options to the appropriate <em>httpd</em> configuration file, e.g. <em>ssl.conf</em>, and be sure they are in force for the virtual host and namespace locations dedicated to DSpace:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">        ##  SSLVerifyClient can be <span class="code-quote">"optional"</span> or
	<span class="code-quote">"require"</span>
        SSLVerifyClient optional
        SSLVerifyDepth  10
        SSLCACertificateFile
	path-to-your-client-CA-certificate
        SSLOptions StdEnvVars ExportCertData

</pre>
</div></div>
<p>Now consult the <a href="http://tomcat.apache.org/connectors-doc/" title="Apache Jakarta Tomcat Connector">Apache Jakarta Tomcat Connector</a> documentation to configure the <em>mod_jk</em> (note: <b>NOT</b><em>mod_jk2</em>) module. Select the AJP 1.3 connector protocol. Also follow the instructions there to configure your Tomcat server to respond to AJP.</p>

<p><b>To use SSL on Apache HTTPD with mod_webapp</b> consult the DSpace 1.3.2 documentation. Apache have deprecated the <em>mod_webapp</em> connector and recommend using <em>mod_jk</em>.</p>

<p><b>To use Jetty's HTTPS support</b> consult the documentation for the relevant tool.</p>



<h3><a name="Installation-TheHandleServer"></a>The Handle Server</h3>

<p>First a few facts to clear up some common misconceptions:</p>

<ul>
	<li>You don't <b>have</b> to use CNRI's Handle system. At the moment, you need to change the code a little to use something else (e.g PURLs) but that should change soon.</li>
	<li>You'll notice that while you've been playing around with a test server, DSpace has apparently been creating handles for you looking like <em>hdl:123456789/24</em> and so forth. These aren't really Handles, since the global Handle system doesn't actually know about them, and lots of other DSpace test installs will have created the same IDs. They're only really Handles once you've registered a prefix with CNRI (see below) and have correctly set up the Handle server included in the DSpace distribution. This Handle server communicates with the rest of the global Handle infrastructure so that anyone that understands Handles can find the Handles your DSpace has created.<br/>
If you want to use the Handle system, you'll need to set up a Handle server. This is included with DSpace. Note that this is not required in order to evaluate DSpace; you only need one if you are running a production service. You'll need to obtain a Handle prefix from <a href="http://www.handle.net/" title="the central CNRI Handle site">the central CNRI Handle site</a>.</li>
</ul>


<p>A Handle server runs as a separate process that receives TCP requests from other Handle servers, and issues resolution requests to a global server or servers if a Handle entered locally does not correspond to some local content. The Handle protocol is based on TCP, so it will need to be installed on a server that can broadcast and receive TCP on port 2641.</p>

<ol>
	<li>To configure your DSpace installation to run the handle server, run the following command: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace make-handle-config [dspace]/handle-server</pre>
</div></div>
<p> Ensure that <em>[dspace]/handle-server</em> matches whatever you have in <em>dspace.cfg</em> for the <em>handle.dir</em> property.</p></li>
	<li>Edit the resulting <em>[dspace]/handle-server/config.dct</em> file to include the following lines in the <em>"server_config"</em> clause: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"><span class="code-quote">"storage_type"</span> = <span class="code-quote">"CUSTOM"</span>
<span class="code-quote">"storage_class"</span> = <span class="code-quote">"org.dspace.handle.HandlePlugin"</span>
</pre>
</div></div>
<p>This tells the Handle server to get information about individual Handles from the DSpace code.</p></li>
	<li>Once the configuration file has been generated, you will need to go to <a href="http://hdl.handle.net/4263537/5014">http://hdl.handle.net/4263537/5014</a> to upload the generated sitebndl.zip file. The upload page will ask you for your contact information. An administrator will then create the naming authority/prefix on the root service (known as the Global Handle Registry), and notify you when this has been completed. You will not be able to continue the handle server installation until you receive further information concerning your naming authority.</li>
	<li>When CNRI has sent you your naming authority prefix, you will need to edit the <em>config.dct</em> file. The file will be found in <em>/[dspace]/handle-server</em>. Look for <em>"300:0.NA/YOUR_NAMING_AUTHORITY"</em>. Replace <em>YOUR_NAMING_AUTHORITY</em> with the assigned naming authority prefix sent to you.</li>
	<li>Now start your handle server (as the dspace user): 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/start-handle-server</pre>
</div></div>
<p>Note that since the DSpace code manages individual Handles, administrative operations such as Handle creation and modification aren't supported by DSpace's Handle server.</p></li>
</ol>


<h4><a name="Installation-UpdatingExistingHandlePrefixes"></a>Updating Existing Handle Prefixes</h4>

<p>If you need to update the handle prefix on items created before the CNRI registration process you can run the <em>[dspace]/bin/dspace update-handle-prefix script</em>. You may need to do this if you loaded items prior to CNRI registration (e.g. setting up a demonstration system prior to migrating it to production). The script takes the current and new prefix as parameters. For example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace update-handle-prefix 123456789 1303
                </pre>
</div></div>
<p>This script will change any handles currently assigned prefix 123456789 to prefix 1303, so for example handle 123456789/23 will be updated to 1303/23 in the database.</p>



<h3><a name="Installation-GoogleandHTMLsitemaps"></a>Google and HTML sitemaps</h3>

<p>To aid web crawlers index the content within your repository, you can make use of sitemaps. There are currently two forms of sitemaps included in DSpace; Google sitemaps and HTML sitemaps.</p>

<p>Sitemaps allow DSpace to expose it's content without the crawlers having to index every page. HTML sitemaps provide a list of all items, collections and communities in HTML format, whilst Google sitemaps provide the same information in gzipped XML format.</p>

<p>To generate the sitemaps, you need to run <em>[dspace]/bin/generate-sitemaps</em> This creates the sitemaps in <em>[dspace]/sitemaps/</em></p>

<p>The sitemaps can be accessed from the following URLs:</p>

<ul>
	<li><a href="http://dspace.example.com/dspace/sitemap">http://dspace.example.com/dspace/sitemap</a> &#45; Index sitemap</li>
	<li><a href="http://dspace.example.com/dspace/sitemap?map=0">http://dspace.example.com/dspace/sitemap?map=0</a> &#45; First list of items (up to 50,000)</li>
	<li><a href="http://dspace.example.com/dspace/sitemap?map=n">http://dspace.example.com/dspace/sitemap?map=n</a> &#45; Subsequent lists of items (e.g. 50,0001 to 100,000) etc...<br/>
HTML sitemaps follow the same procedure:</li>
	<li><a href="http://dspace.example.com/dspace/htmlmap">http://dspace.example.com/dspace/htmlmap</a> &#45; Index HTML based sitemap</li>
	<li>etc...</li>
</ul>


<p>When running <em>[dspace]/bin/generate-sitemaps</em> the script informs Google that the sitemaps have been updated. For this update to register correctly, you must first register your Google sitemap index page (<em>/dspace/sitemap</em>) with Google at <a href="http://www.google.com/webmasters/sitemaps/" title="http://www.google.com/webmasters/sitemaps/">http://www.google.com/webmasters/sitemaps/</a>. If your DSpace server requires the use of a HTTP proxy to connect to the Internet, ensure that you have set <em>http.proxy.host</em> and <em>http.proxy.port</em> in <em>[dspace]/config/dspace.cfg</em></p>

<p>The URL for pinging Google, and in future, other search engines, is configured in <em>[dspace-space]/config/dspace.cfg</em> using the <em>sitemap.engineurls</em> setting where you can provide a comma-separated list of URLs to 'ping'.</p>

<p>You can generate the sitemaps automatically every day using an additional cron job:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"># Generate sitemaps


0 6 * * * [dspace]/bin/generate-sitemaps

</pre>
</div></div>

<h3><a name="Installation-DSpaceStatistics"></a>DSpace Statistics</h3>

<p>DSpace uses the Apache Solr application underlaying the statistics. There is no need to download any separate software. All the necessary software is included. To understand all of the configuration property keys, the user should refer to 5.2.35 DSpace Statistic Configuration for detailed information.</p>

<ol>
	<li><b>DSpace Configuration for Accessing Solr.</b> In the <em>dspace.cfg</em> file review the following fields to make sure they are uncommented:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">solr.log.server = ${dspace.baseUrl}/solr/statistics
solr.dbfile = ${dspace.dir}/config/GeoLiteCity.dat
solr.spiderips.urls = http:<span class="code-comment">//iplists.com/google.txt, \
</span>                      http:<span class="code-comment">//iplists.com/inktomi.txt, \
</span>                      http:<span class="code-comment">//iplists.com/lycos.txt, \
</span>                      http:<span class="code-comment">//iplists.com/infoseek.txt, \
</span>                      http:<span class="code-comment">//iplists.com/altavista.txt, \
</span>                      http:<span class="code-comment">//iplists.com/excite.txt, \
</span>                      http:<span class="code-comment">//iplists.com/misc.txt, \
</span>                      http:<span class="code-comment">//iplists.com/non_engines.txt</span></pre>
</div></div></li>
	<li><b>DSpace logging configuration for Solr.</b> If your DSpace instance is protected by a proxy server, in order for Solr to log the correct IP address of the user rather than of the proxy, it must be configured to look for the X-Forwarded-For header.&nbsp; This feature can be enabled by ensuring the following setting is uncommented in the logging section of <em>dspace.cfg</em>:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">useProxies = <span class="code-keyword">true</span></pre>
</div></div></li>
	<li><b>Configuration Control.</b> In the <em>dspace.cfg</em> set the following property key:_statistics.item.authorization.admin=true_This will require the user to sign on to see that statistics. Setting the statistics to "false" will make them publicly available.</li>
	<li>Final steps.
	<ul>
		<li>Perform the following step: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">cd [dspace-source]/dspace
mvn <span class="code-keyword">package</span>
cd [dspace-source]/dspace/target/dspace-&lt;version&gt;-build.dir
ant -Dconfig=[dspace]/config/dspace.cfg update
cp -R [dspace]/webapps/* [TOMCAT]/webapps
</pre>
</div></div>
<p>If you only need to build the statistics, and don't make any changes to other web applications, you can replace the copy step above with: <em>cp &#45;R [dspace]/webapps/solr [TOMCAT]/webapps</em></p></li>
		<li>Restart your webapps (Tomcat/Jetty/Resin)</li>
	</ul>
	</li>
</ol>



<h2><a name="Installation-WindowsInstallation"></a>Windows Installation</h2>

<h3><a name="Installation-PrerequisiteSoftware"></a>Pre-requisite Software</h3>

<p>If you are installing DSpace on Windows, you will still need to install all the same <a href="#Installation-PrerequisiteSoftware">Prerequisite Software</a>, as listed above.</p>

<ul>
	<li>If you install PostgreSQL, it's recommended to select to install the pgAdmin III tool.  It provides a nice User Interface for interacting with PostgreSQL databases.</li>
</ul>


<h3><a name="Installation-InstallationSteps"></a>Installation Steps</h3>

<ol>
	<li>Download the DSpace source from <a href="http://sourceforge.net/projects/dspace" title="SourceForge">SourceForge</a> and unzip it (<a href="http://www.winzip.com/" title="WinZip">WinZip</a> will do this)</li>
	<li>Ensure the PostgreSQL service is running, and then run pgAdmin III (Start &#45;&gt; PostgreSQL 8.0 &#45;&gt; pgAdmin III). Connect to the local database as the postgres user and:
	<ul>
		<li>Create a 'Login Role' (user) called <em>dspace</em> with the password <em>dspace</em></li>
		<li>Create a database called <em>dspace</em> owned by the user <em>dspace</em>, with UTF-8 encoding</li>
	</ul>
	</li>
	<li>Update paths in <em>[dspace-source]\dspace\config\dspace.cfg</em>. <b>Note:</b> Use forward slashes / for path separators, though you can still use drive letters, e.g.:_dspace.dir = C:/DSpace_Make sure you change all of the parameters with file paths to suit, specifically: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">        dspace.dir
        config.template.log4j.properties
        config.template.log4j-handle-plugin.properties
        config.template.oaicat.properties
        assetstore.dir
        log.dir
        upload.temp.dir
        report.dir
        handle.dir
</pre>
</div></div></li>
	<li>Create the directory for the DSpace installation (e.g. <em>C:\DSpace</em>)</li>
	<li>Generate the DSpace installation package by running the following from command line (cmd) from your <em>[dspace-source]/dspace/</em> directory: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">mvn <span class="code-keyword">package</span>
</pre>
</div></div>
	<ul>
		<li><em>Note #1:</em> This will generate the DSpace installation package in your <em>[dspace-source]/dspace/target/dspace-[version]-build.dir/</em> directory.</li>
		<li><em>Note #2:</em> Without any extra arguments, the DSpace installation package is initialized for PostgreSQL. If you want to use Oracle instead, you should build the DSpace installation package as follows:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">mvn -Ddb.name=oracle <span class="code-keyword">package</span></pre>
</div></div></li>
	</ul>
	</li>
	<li>Initialize the DSpace database and install DSpace to <em>[dspace]</em> (e.g. <em>C:\DSpace</em>) by running the following from command line from your <em>[dspace-source]/dspace/target/dspace-[version]-build.dir/</em> directory:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">ant fresh_install</pre>
</div></div>
	<ul>
		<li><em>Note:</em> to see a complete list of build targets, run: <tt>ant help</tt></li>
	</ul>
	</li>
	<li>Create an administrator account, by running the following from your <em>[dspace]</em> (e.g. <em>C:\DSpace</em>) directory:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]\bin\dspace create-administrator</pre>
</div></div></li>
	<li>Copy the Web application directories from <em>[dspace]\webapps</em> to Tomcat's webapps dir, which should be somewhere like <em>C:\Program Files\Apache Software Foundation\Tomcat\webapps</em>
	<ul>
		<li>Alternatively, Tell your Tomcat installation where to find your DSpace web application(s). As an example, in the <em>&lt;Host&gt;</em> section of your <em>[tomcat]/conf/server.xml</em> you could add lines similar to the following (but replace <em>[dspace]</em> with your installation location):
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;!-- DEFINE A CONTEXT PATH FOR DSpace JSP User Interface  --&gt;
&lt;Context path=<span class="code-quote">"/jspui"</span> docBase=<span class="code-quote">"[dspace]\webapps\jspui"</span> debug=<span class="code-quote">"0"</span>
	reloadable=<span class="code-quote">"<span class="code-keyword">true</span>"</span> cachingAllowed=<span class="code-quote">"<span class="code-keyword">false</span>"</span>
	allowLinking=<span class="code-quote">"<span class="code-keyword">true</span>"</span>/&gt;

&lt;!-- DEFINE A CONTEXT PATH FOR DSpace OAI User Interface  --&gt;
&lt;Context path=<span class="code-quote">"/oai"</span> docBase=<span class="code-quote">"[dspace]\webapps\oai"</span> debug=<span class="code-quote">"0"</span>
	reloadable=<span class="code-quote">"<span class="code-keyword">true</span>"</span> cachingAllowed=<span class="code-quote">"<span class="code-keyword">false</span>"</span>
	allowLinking=<span class="code-quote">"<span class="code-keyword">true</span>"</span>/&gt;
</pre>
</div></div></li>
	</ul>
	</li>
	<li>Start the Tomcat service</li>
	<li>Browse to either <a href="http://localhost:8080/jspui">http://localhost:8080/jspui</a> or <a href="http://localhost:8080/xmlui">http://localhost:8080/xmlui</a>. You should see the DSpace home page for either the JSPUI or XMLUI, respectively.</li>
</ol>



<h2><a name="Installation-CheckingYourInstallation"></a>Checking Your Installation</h2>

<p>The administrator needs to check the installation to make sure all components are working. Here is list of checks to be performed. In brackets after each item, it the associated component or components that might be the issue needing resolution.</p>

<ul>
	<li>System is up and running. <em>User can see the DSpace home page. [Tomcat/Jetty, firewall, IP assignment, DNS]</em></li>
	<li>Database is running and working correctly. <em>Attempt to create a user, community or collection [PostgreSQL, Oracle]</em><em>Run the test database command to see if other issues are being report:</em><em>[dspace]/bin/dspace test-database</em></li>
	<li>Email subsystem is running. The user can issue the following command to test the email system. t attempts to send a test email to the email address that is set in dspace.cfg (mail.admin). If it fails, you will get messages informing you as to why, will refer you to the DSpace documentation. <em>[dspace]/bin/test-email</em></li>
</ul>


<h2><a name="Installation-KnownBugs"></a>Known Bugs</h2>

<p>In any software project of the scale of DSpace, there will be bugs. Sometimes, a stable version of DSpace includes known bugs. We do not always wait until every known bug is fixed before a release. If the software is sufficiently stable and an improvement on the previous release, and the bugs are minor and have known workarounds, we release it to enable the community to take advantage of those improvements.</p>

<p>The known bugs in a release are documented in the <em>KNOWN_BUGS</em> file in the source package.</p>

<p>Please see the <a href="https://jira.duraspace.org/browse/DS">DSpace bug tracker</a> for further information on current bugs, and to find out if the bug has subsequently been fixed. This is also where you can report any further bugs you find.</p>


<h2><a name="Installation-CommonProblems"></a>Common Problems</h2>

<p>In an ideal world everyone would follow the above steps and have a fully functioning DSpace. Of course, in the real world it doesn't always seem to work out that way. This section lists common problems that people encounter when installing DSpace, and likely causes and fixes. This is likely to grow over time as we learn about users' experiences.</p>

<ul>
	<li><b>Database errors occur when you run</b> <tt>ant fresh_install</tt>:  There are two common errors that occur.
	<ul>
		<li>If your error looks like this: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[java] 2004-03-25 15:17:07,730 INFO
	    org.dspace.storage.rdbms.InitializeDatabase @ Initializing Database
[java] 2004-03-25 15:17:08,816 FATAL
	    org.dspace.storage.rdbms.InitializeDatabase @ Caught exception:
[java] org.postgresql.util.PSQLException: Connection refused. Check
	    that the hostname and port are correct and that the postmaster is
	    accepting TCP/IP connections.
[java]     at
	    org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJd
bc1Connection.java:204)
[java]     at org.postgresql.Driver.connect(Driver.java:139)</pre>
</div></div>
<p> it usually means you haven't yet added the relevant configuration parameter to your PostgreSQL configuration (see above), or perhaps you haven't restarted PostgreSQL after making the change. Also, make sure that the <em>db.username</em> and <em>db.password</em> properties are correctly set in <em>[dspace-source]/config/dspace.cfg</em>. An easy way to check that your DB is working OK over TCP/IP is to try this on the command line: </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">psql -U dspace -W -h localhost</pre>
</div></div>
<p> Enter the <em>dspace</em> database password, and you should be dropped into the psql tool with a <em>dspace=&gt;</em> prompt.</p></li>
		<li>Another common error looks like this: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[java] 2004-03-25 16:37:16,757 INFO
	    org.dspace.storage.rdbms.InitializeDatabase @ Initializing Database
[java] 2004-03-25 16:37:17,139 WARN
	    org.dspace.storage.rdbms.DatabaseManager @ Exception initializing DB
	    pool
[java] java.lang.ClassNotFoundException: org.postgresql.Driver
[java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
[java]     at java.security.AccessController.doPrivileged(Native
	   Method)
[java]     at
	   java.net.URLClassLoader.findClass(URLClassLoader.java:186)</pre>
</div></div>
<p> This means that the PostgreSQL JDBC driver is not present in <em>[dspace-source]/lib</em>. See above.</p></li>
	</ul>
	</li>
	<li><b>Tomcat doesn't shut down</b>:  If you're trying to tweak Tomcat's configuration but nothing seems to make a difference to the error you're seeing, you might find that Tomcat hasn't been shutting down properly, perhaps because it's waiting for a stale connection to close gracefully which won't happen.
	<ul>
		<li>To see if this is the case, try running: <tt>ps &#45;ef &#124; grep java</tt> and look for Tomcat's Java processes. If they stay around after running Tomcat's <em>shutdown.sh</em> script, trying running <tt>kill</tt> on them (or <tt>kill &#45;9</tt> if necessary), then starting Tomcat again.</li>
	</ul>
	</li>
	<li><b>Database connections don't work, or accessing DSpace takes forever</b>:  If you find that when you try to access a DSpace Web page and your browser sits there connecting, or if the database connections fail, you might find that a 'zombie' database connection is hanging around preventing normal operation.
	<ul>
		<li>To see if this is the case, try running: <tt>ps &#45;ef &#124; grep postgres</tt></li>
		<li>You might see some processes like this: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">dspace 16325  1997  0  Feb 14  ?         0:00 postgres: dspace dspace    127.0.0.1 idle in transaction</pre>
</div></div>
<p> This is normal. DSpace maintains a 'pool' of open database connections, which are re-used to avoid the overhead of constantly opening and closing connections. If they're 'idle' it's OK; they're waiting to be used.</p></li>
		<li>However sometimes, if something went wrong, they might be stuck in the middle of a query, which seems to prevent other connections from operating, e.g.: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">dspace 16325  1997  0  Feb 14  ?         0:00 postgres: dspace dspace    127.0.0.1 SELECT</pre>
</div></div>
<p> This means the connection is in the middle of a <em>SELECT</em> operation, and if you're not using DSpace right that instant, it's probably a 'zombie' connection. If this is the case, try running <tt>kill</tt> on the process, and stopping and restarting Tomcat.</p></li>
	</ul>
	</li>
</ul>


				    					    <br/>
                        <div class="tabletitle">
                            <a name="attachments">Attachments:</a>
                        </div>

                        <div class="greybox" align="left">
                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
                                <a href="attachments/22022840/22675570.png">warning.png</a> (image/png)
                                <br/>
                                                    </div>
				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="https://wiki.duraspace.org/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Mar 25, 2011 19:21</font></td>
		    </tr>
	    </table>
    </body>
</html>